package com.zjgsu.nftplatform.service.impl;

import cn.hutool.core.lang.Pair;
import cn.hutool.core.map.MapUtil;
import com.zjgsu.nftplatform.service.AccountService;
import com.zjgsu.nftplatform.util.PostUtil;
import org.springframework.stereotype.Service;

/**
 * @author ahy231
 * @date 2022/4/23 20:13
 * @description
 */
@Service
public class AccountServiceImpl implements AccountService {

    private final PostUtil postUtil;

    public AccountServiceImpl(PostUtil postUtil) {
        this.postUtil = postUtil;
    }

    @Override
    public String newAccount(String password) {
        return postUtil.accountPost(MapUtil.<String, String>of(
                Pair.of("method", "createAccount"),
                Pair.of("password", password)
        ));
    }
}
